From 60f6b298329728fc8a91cd8c688c9b38fa302f0d Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Thu, 20 Feb 2025 18:41:18 -0500
Subject: Remove the last lingering Svelte4-style event bindings.

---
 ui/routes/(app)/ch/[channel]/+page.svelte | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'ui/routes/(app)/ch/[channel]/+page.svelte')

diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte
index dbdb507..9335198 100644
--- a/ui/routes/(app)/ch/[channel]/+page.svelte
+++ b/ui/routes/(app)/ch/[channel]/+page.svelte
@@ -58,7 +58,7 @@
   }
 
   let lastReadCallback = null;
-  function handleScroll() {
+  function onscroll() {
     clearTimeout(lastReadCallback); // Fine if lastReadCallback is null still.
     lastReadCallback = setTimeout(setLastRead, 2 * 1000);
   }
@@ -66,7 +66,7 @@
 
 <svelte:window onkeydown={handleKeydown} />
 
-<div class="active-channel" on:scroll={handleScroll} bind:this={activeChannel}>
+<div class="active-channel" {onscroll} bind:this={activeChannel}>
   <ActiveChannel {messageRuns} />
 </div>
 <div class="create-message">
-- 
cgit v1.2.3


From 25daf36b18086096651b381223ad8f03fbca5045 Mon Sep 17 00:00:00 2001
From: Owen Jacobson <owen@grimoire.ca>
Date: Fri, 21 Feb 2025 17:07:35 -0500
Subject: Retire use of $page store in favour of Sv5 page state

---
 ui/routes/(app)/+layout.svelte            | 4 ++--
 ui/routes/(app)/ch/[channel]/+page.svelte | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

(limited to 'ui/routes/(app)/ch/[channel]/+page.svelte')

diff --git a/ui/routes/(app)/+layout.svelte b/ui/routes/(app)/+layout.svelte
index a81efce..6339abd 100644
--- a/ui/routes/(app)/+layout.svelte
+++ b/ui/routes/(app)/+layout.svelte
@@ -1,5 +1,5 @@
 <script>
-  import { page } from '$app/stores';
+  import { page } from '$app/state';
   import { goto } from '$app/navigation';
   import { browser } from '$app/environment';
   import { getContext, onDestroy, onMount } from 'svelte';
@@ -17,7 +17,7 @@
   let pageContext = getContext('page');
   let { children } = $props();
   let loading = $state(true);
-  let channel = $derived($page.params.channel);
+  let channel = $derived(page.params.channel);
 
   let rawChannels = $derived($channelsList.channels);
   let rawMessages = $derived($messages);
diff --git a/ui/routes/(app)/ch/[channel]/+page.svelte b/ui/routes/(app)/ch/[channel]/+page.svelte
index 9335198..84cb0ae 100644
--- a/ui/routes/(app)/ch/[channel]/+page.svelte
+++ b/ui/routes/(app)/ch/[channel]/+page.svelte
@@ -1,11 +1,11 @@
 <script>
   import { DateTime } from 'luxon';
-  import { page } from '$app/stores';
+  import { page } from '$app/state';
   import ActiveChannel from '$lib/components/ActiveChannel.svelte';
   import MessageInput from '$lib/components/MessageInput.svelte';
   import { channelsList, messages } from '$lib/store';
 
-  let channel = $derived($page.params.channel);
+  let channel = $derived(page.params.channel);
   let messageRuns = $derived($messages.inChannel(channel));
   let activeChannel;
 
@@ -58,6 +58,7 @@
   }
 
   let lastReadCallback = null;
+
   function onscroll() {
     clearTimeout(lastReadCallback); // Fine if lastReadCallback is null still.
     lastReadCallback = setTimeout(setLastRead, 2 * 1000);
-- 
cgit v1.2.3

